package com.qingrongby.shop.service.impl;

import com.qingrongby.shop.model.Banner;
import com.qingrongby.shop.repository.BannerRepository;
import com.qingrongby.shop.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

@Service
public class BannerServiceImpl implements BannerService {

    @Autowired
    BannerRepository bannerRepository;

    @Override
    public Banner findByName(String name) {
        Banner banner = bannerRepository.findOneByName(name);
        return banner;
    }

    @Override
    public Banner findById(Long id) {
        Banner banner = bannerRepository.findOneById(id);
        return banner;
    }
}
